package com.atguigu.gmall.realtime.test;

import com.atguigu.gmall.realtime.common.base.BaseApp;
import com.atguigu.gmall.realtime.common.constant.Constant;
import org.apache.flink.api.common.eventtime.WatermarkStrategy;
import org.apache.flink.api.common.serialization.SimpleStringSchema;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.connector.kafka.source.KafkaSource;
import org.apache.flink.connector.kafka.source.enumerator.initializer.OffsetsInitializer;
import org.apache.flink.runtime.state.hashmap.HashMapStateBackend;
import org.apache.flink.streaming.api.CheckpointingMode;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.OffsetResetStrategy;

import static org.apache.flink.streaming.api.environment.CheckpointConfig.ExternalizedCheckpointCleanup.RETAIN_ON_CANCELLATION;

public class RealTime01_TestFlinkCodeStep extends BaseApp {
    @Override
    public void handle(StreamExecutionEnvironment env, DataStreamSource<String> stream) {
        // 2. 对数据进行处理
        stream.print();
    }

    public static void main(String[] args) {
        // 1. 调用start方法
        new RealTime01_TestFlinkCodeStep().start(5678, 4, "gmall-realtime", Constant.TOPIC_DB);


    }
}
